class chooseGui {
    /**
     * 
     * @param title 窗口标题
     * @param skillName 技能名称
     * @param lv 职业表格控件名
     * @param Arraydata 下拉框数据数组
     * @param noteText 提示文本
     */
    __New(title, skillName, lv, row, Arraydata := ["是", "否"], noteText := "") {
        this.title := title
        this.skillName := skillName
        this.lv := lv
        this.rowNum := row
        this.arraydata := Arraydata
        this.noteText := noteText
        this.addGui()
    }
    addGui() {
        this.gui := Gui(, this.title "设置")
        this.gui.SetFont("s11", "微软雅黑")
        this.gui.Opt("AlwaysOnTop -SysMenu Owner" main.Hwnd)
        this.gui.Add("Text", "x10 y10", this.skillName "：")
        this.ddlData := this.gui.Add("DropDownList", "x10 y+10 w100 Choose1 Hidden", this.arraydata)
        this.timeDelay := this.gui.Add("Edit", "x10 y35 w100 Hidden")
        this.noteText := this.gui.Add("Text", "x10 y+10", this.noteText)
        this.btnChoose := this.gui.Add("Button", "x10 y+10 w80 h40 vbtnChoose", "确定")
        this.btnCancel := this.gui.Add("Button", "x+10 wp hp vbtnCancel", "取消")

        this.btnChoose.OnEvent("Click", (*) => this.btnChooseEvent())
        this.btnCancel.OnEvent("Click", (*) => this.btnCancelEvent())
    }
    showGui() {
        if (this.gui == "") {
            this.addGui()
            this.gui.show()
        } else {
            this.gui.show()
        }
    }
    Destroy() {
        this.gui.Destroy()
        this.gui := ""
    }
    btnChooseEvent(*) {
        if (this.lv != "") {
            if this.ddlData.Visible
                this.lv.Modify(this.rowNum, "Col4", this.ddlData.Text)
            else
                this.lv.Modify(this.rowNum, "Col4", this.timeDelay.Text)
        }
        this.Destroy()
    }
    btnCancelEvent(*) {
        this.Destroy()
    }
}